import 'package:ysy_flutter_mvvm_yuanxuan/bean/base/BaseBean.dart';

class HomeAttentionBean implements BaseJsonBean{
  List<AdvertiseList>? advertiseList;
  List<FrequentlyViewList>? frequentlyViewList; //常访问

  HomeAttentionBean({this.advertiseList, this.frequentlyViewList});

  HomeAttentionBean.fromJson(Map<String, dynamic> json) {
    if (json['advertiseList'] != null) {
      advertiseList = [];
      json['advertiseList'].forEach((v) {
        advertiseList?.add(new AdvertiseList.fromJson(v));
      });
    }
    if (json['frequentlyViewList'] != null) {
      frequentlyViewList = <FrequentlyViewList>[];
      json['frequentlyViewList'].forEach((v) {
        frequentlyViewList?.add(new FrequentlyViewList.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.advertiseList != null) {
      data['advertiseList'] =
          this.advertiseList!.map((v) => v.toJson()).toList();
    }
    if (this.frequentlyViewList != null) {
      data['frequentlyViewList'] =
          this.frequentlyViewList!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class AdvertiseList {
  int? id;
  String? name;
  int? type;
  String? pic;
  String? startTime;
  String? endTime;
  int? status;
  int? clickCount;
  int? orderCount;
  String? url;
  String? note;
  int? sort;
  String? color;
  int? advertiseType;
  String? productId;
  String? storeId;

  AdvertiseList(
      {this.id,
        this.name,
        this.type,
        this.pic,
        this.startTime,
        this.endTime,
        this.status,
        this.clickCount,
        this.orderCount,
        this.url,
        this.note,
        this.sort,
        this.color,
        this.advertiseType,
        this.productId,
        this.storeId});

  AdvertiseList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    type = json['type'];
    pic = json['pic'];
    startTime = json['startTime'];
    endTime = json['endTime'];
    status = json['status'];
    clickCount = json['clickCount'];
    orderCount = json['orderCount'];
    url = json['url'];
    note = json['note'];
    sort = json['sort'];
    color = json['color'];
    advertiseType = json['advertiseType'];
    productId = json['productId'];
    storeId = json['storeId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['type'] = this.type;
    data['pic'] = this.pic;
    data['startTime'] = this.startTime;
    data['endTime'] = this.endTime;
    data['status'] = this.status;
    data['clickCount'] = this.clickCount;
    data['orderCount'] = this.orderCount;
    data['url'] = this.url;
    data['note'] = this.note;
    data['sort'] = this.sort;
    data['color'] = this.color;
    data['advertiseType'] = this.advertiseType;
    data['productId'] = this.productId;
    data['storeId'] = this.storeId;
    return data;
  }
}

class FrequentlyViewList {
  String? id;
  String? memberId;
  String? memberNickname;
  String? memberIcon;
  String? storeId;
  String? storeName;
  String? storeLogo;
  String? storeCity;
  String? createTime;

  FrequentlyViewList(
      {this.id,
        this.memberId,
        this.memberNickname,
        this.memberIcon,
        this.storeId,
        this.storeName,
        this.storeLogo,
        this.storeCity,
        this.createTime});

  FrequentlyViewList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    memberId = json['memberId'];
    memberNickname = json['memberNickname'];
    memberIcon = json['memberIcon'];
    storeId = json['storeId'];
    storeName = json['storeName'];
    storeLogo = json['storeLogo'];
    storeCity = json['storeCity'];
    createTime = json['createTime'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['memberId'] = this.memberId;
    data['memberNickname'] = this.memberNickname;
    data['memberIcon'] = this.memberIcon;
    data['storeId'] = this.storeId;
    data['storeName'] = this.storeName;
    data['storeLogo'] = this.storeLogo;
    data['storeCity'] = this.storeCity;
    data['createTime'] = this.createTime;
    return data;
  }
}
